package com.peng.controller;

import com.peng.result.ResultData;
import com.peng.service.StorageService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class StorageController {

    @Resource
    private StorageService storageService;

    @RequestMapping("/storage/decrease")
    public ResultData  decrease(@RequestParam("productId") Long productId,
                                @RequestParam("count") Integer count){
        storageService.decrease(productId,count);
        return ResultData.success("扣减库存成功");
    }
}
